package com.graduate.after.service.impl;

import com.graduate.after.bean.SlideShow;
import com.graduate.after.mapper.SlideShowMapper;
import com.graduate.after.service.SlideShowService;
import com.graduate.after.web.control.UserInfoControl;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SlideShowServiceImpl implements SlideShowService {
    private static Logger log = Logger.getLogger(SlideShowServiceImpl.class.getClass());

    @Autowired
    private SlideShowMapper slideShowMapper;

    @Override
    public List<SlideShow> homeSlideShowSelect() {
        List<SlideShow> slideShows = slideShowMapper.homeSlideShowSelect();
        log.info("首页查询了轮播图,共"+slideShows.size()+"张图片");
        return slideShows                                                                                                                               ;
    }

    @Override
    public List<SlideShow> detailSlideShowSelect(Long iid) {
        List<SlideShow> slideShows = slideShowMapper.detailSlideShowSelect(iid);
        log.info("详情页查询了轮播图,共"+slideShows.size()+"张图片");
        return slideShows;
    }
}
